home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
science
/
sm32a.zip
/
KEYWORD
/
SIGN.KEY
< prev
next >
Wrap
Text File
|
1993-11-07
|
517b
|
17 lines
* sign internal
sign(x) is the sign function of x. Its value is 1, 0 or -1.
/ 1 if re(x) > 0; or both re(x) = 0 and im(x) > 0.
sign(x) = 0 if x=0.
\ -1 otherwise.
the same as the definition by arg(x):
/ 1 if -pi/2 < arg(x) <= pi/2.
sign(x) = 0 if x=0.
\ -1 otherwise.
You can assume x is positive or negative by sign(x) := 1 or sign(x) := -1.
e.g. sign(2) gives 1, sign(1+i) gives 1.
See also: abs, arg, re, im, >, <.